<?php
require './config.php';
$sql="select * from lyb";
$result = mysqli_query($link,$sql);
//var_dump($result);exit;
while($ros=mysqli_fetch_assoc($result)) {
    $res[]=$ros;
};
//var_dump($res);
//echo "<pre>";
//    print_r($res);
//echo "</pre>";
//exit;
?>

<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport"
        content="width=device-width, initial-scale=1">
  <title>Amaze UI Examples</title>

  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">

  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>

  <link rel="icon" type="image/png" href="assets/i/favicon.png">

  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="assets/i/app-icon72x72@2x.png">

  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">

  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">

  <!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
  <!--
  <link rel="canonical" href="http://www.example.com/">
  -->

  <link rel="stylesheet" href="assets/css/amazeui.min.css">
  <link rel="stylesheet" href="assets/css/app.css">
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a
  href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<header class="am-topbar am-topbar-inverse">
  <div class="am-container">
    <h1 class="am-topbar-brand">
      <span class="am-icon-comments"> 留言板</span>
    </h1>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-secondary am-show-sm-only" data-am-collapse="{target: '#collapse-head'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="collapse-head">
      <ul class="am-nav am-nav-pills am-topbar-nav">
        <li class="am-active"><a href="#">首页</a></li>
        <li><a href="#">项目</a></li>
        <li class="am-dropdown" data-am-dropdown="">
          <a class="am-dropdown-toggle" data-am-dropdown-toggle="" href="javascript:;">
            下拉菜单 <span class="am-icon-caret-down"></span>
          </a>
          <ul class="am-dropdown-content">
            <li class="am-dropdown-header">标题</li>
            <li><a href="#">1. 默认样式</a></li>
            <li><a href="#">2. 基础设置</a></li>
            <li><a href="#">3. 文字排版</a></li>
            <li><a href="#">4. 网格系统</a></li>
          </ul>
        </li>
      </ul>

      <div class="am-topbar-right">
        <button class="am-btn am-btn-secondary am-topbar-btn am-btn-sm"><span class="am-icon-pencil"></span> 注册</button>
      </div>

      <div class="am-topbar-right">
        <button class="am-btn am-btn-primary am-topbar-btn am-btn-sm"><span class="am-icon-user"></span> 登录</button>
      </div>
    </div>
  </div>
</header>
<div class="am-container">
  <h2>共28条留言</h2>
  <div class="am-panel am-panel-primary">
    <div class="am-panel-hd">留言内容</div>
      <?php
      foreach ($res as $key=>$val){?>
        <div class="am-panel-bd">
      <article class="am-comment">
        <a href="#link-to-user-home">
          <img src="<?php echo empty($val['img'])?'./imgs/书.jpg':$val['img'];?>" class="am-comment-avatar" width="48" height="48"/>
        </a>

        <div class="am-comment-main">
          <header class="am-comment-hd">
            <!--<h3 class="am-comment-title">评论标题</h3>-->
            <div class="am-comment-meta">
                <a href="#link-to-user" class="am-comment-author"><?php
                    echo empty($val['name'])?'某人':$val['name'];
               ?></a>
                评论于 <time datetime="2013-07-27T04:54:29-07:00" title="2013年7月27日 下午7:54 格林尼治标准时间+0800">2014-7-12 15:30</time>
            </div>
          </header>

          <div class="am-comment-bd">
            <?php echo empty($val['content'])?'未知评论':$val['content'];?>
          </div>
        </div>
      </article>
    </div>
          <?php
      }
      ?>

  </div>


  <div class="am-panel am-panel-primary">
    <div class="am-panel-hd">发表留言</div>
    <div class="am-panel-bd">

      <form class="am-form" method="post" action="./action.php">
        <fieldset>
          <div class="am-form-group">
            <label for="doc-ipt-email-1">留言标题</label>
            <input type="text" name="title" id="doc-ipt-email-1" placeholder="输入留言标题">
          </div>

          <div class="am-form-group">
            <label for="doc-ipt-pwd-1">用户网名</label>
            <input type="text" name="name" id="doc-ipt-pwd-1" placeholder="输入用户网名">
          </div>
          <div class="am-form-group">
            <label for="doc-ta-1">留言内容</label>
            <textarea type="text" name="content" rows="5" id="doc-ta-1"placeholder="输入留言内容"></textarea>
          </div>
          <p><button type="submit" class="am-btn am-btn-primary am-btn-block">提交留言</button></p>
        </fieldset>
      </form>
    </div>
  </div>

</div>


<!--[if lt IE 9]>
<script src=""></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="assets/js/amazeui.min.js"></script>

</body>
</html>
